#!/bin/bash
export zope_i18n_compile_mo_files=True
case "$1" in
    fg)
        paster serve ${paster_debug_ini:output}
        ;;
    start)
        paster serve ${paster_deploy_ini:output} --daemon --pid-file=${buildout:directory}/var/merlot.pid --log-file=${buildout:directory}/var/log/merlog.log
        ;;
    stop)
        paster serve ${paster_deploy_ini:output} --daemon --pid-file=${buildout:directory}/var/merlot.pid --log-file=${buildout:directory}/var/log/merlog.log stop
        ;;
    restart)
        paster serve ${paster_deploy_ini:output} --daemon --pid-file=${buildout:directory}/var/merlot.pid --log-file=${buildout:directory}/var/log/merlog.log restart
        ;;
    status)
        paster serve ${paster_deploy_ini:output} --daemon --pid-file=${buildout:directory}/var/merlot.pid --log-file=${buildout:directory}/var/log/merlog.log status
        ;;
    *)
        echo "Usage: merlot [fg|start|stop|restart|status]" >&2
        exit 1
        ;;
esac
exit 0
